﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HRMS_Model;

namespace DataManager
{
    public class UserManager
    {
        public static bool ValidateUser(string username, string password)
        {
            using (var userEntity = new HRMSEntities())
            {
                return userEntity.Users.SingleOrDefault(user => user.UserName == username && user.Password == password)!=null;
            }
        }
        public static void AddUser(User userObj)
        {
            using (HRMSEntities userEntity = new HRMSEntities())
            {


                userEntity.Users.AddObject(userObj);

            }
        }


    }
}
